﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class Calligraphy : System.Web.UI.Page
{
    #region code
    public DataSet dset = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        BZZ.DataAcess woker = new BZZ.DataAcess();
        string sql = "select id,realname,headChar from professor where cata='书法' and isAgent='0'";
        dset = woker.Execute(sql);

        List<string> list = new List<string>();
        list.Add("no message needed");
        rptProductList.DataSource = list;
        rptProductList.DataBind();

    }

    /// <summary>
    /// 根据首字母查询对应的名家
    /// </summary>
    /// <param name="word"></param>
    /// <returns></returns>
    public string getProductList(string word)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        DataRow[] rows = dset.Tables[0].Select("headChar='" + word + "'");
        foreach (DataRow row in rows)
        {
            sb.Append("<a href='professorDetail.aspx?id=" + row["id"].ToString() + "'>" + row["realname"].ToString() + "</a>&nbsp;");
        }
        return sb.ToString();
    }

    #endregion

}
